package com.zh.streamdemo.demo1;

import java.util.*;
import java.util.stream.Stream;

public class DemoMatch {

    public static void main(String[] args) {
        boolean anyMatch = Stream.of("地瓜", "土豆", "茄子", "白菜", "土豆", "茄子", "黄瓜").anyMatch(item -> item.equals("地瓜"));
        boolean allMatch = Stream.of("地瓜", "土豆", "茄子", "白菜", "土豆", "茄子", "黄瓜").allMatch(item -> item.contains("瓜"));
        boolean noneMatch = Stream.of("地瓜", "土豆", "茄子", "白菜", "土豆", "茄子", "黄瓜").noneMatch(item -> item.contains("子"));
        System.out.println("anyMatch:" + anyMatch + ";allMatch:" + allMatch + ";noneMatch:" + noneMatch);
    }
}
